package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  会员考评-操作类型枚举
 * @author ds
 * @date 2021/5/8
 * @version 2.0.0
 */
public enum MemberKpiOperateTypeEnum {

    TO_BE_PUBLISH_COUNT(1, "待发布考评表", "/memberCenter/memberAbility/memberEvaluate/createEvaluate"),
    TO_BE_SCORING_COUNT(2, "待考评打分", "/memberCenter/memberAbility/memberEvaluate/tobeEvaluate"),
    TO_BE_COMMIT_COUNT (3, "待提交汇总考评结果", "/memberCenter/memberAbility/memberEvaluate/tobeSubmitSummary"),
    TO_BE_VALIFY_STEP1_COUNT (4, "待审核考评结果(一级)", "/memberCenter/memberAbility/memberEvaluate/tobeReviewI"),
    TO_BE_VALIFY_STEP2_COUNT (5, "待审核考评结果(二级)", "/memberCenter/memberAbility/memberEvaluate/tobeReviewII"),
    TO_BE_NOTICE_COUNT (6, "待通报考评结果", "/memberCenter/memberAbility/memberEvaluate/tobeInformed");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    MemberKpiOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static MemberKpiOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(MemberKpiOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }

}
